/**
 * 随机数工具类
 * @author liu_jshan
 * @version 1.0 20240325
 */

/**
 * 返回一个随机整数，数值位于[start, end) 区间之中
 * @param {*} start 开始 
 * @param {*} end 结束
 * @return 整数
 */
function randomNumberRange(start, end) {
    if (start > end) throw new Error('The start should be greater than the end')
    return Math.floor(Math.random() * (end - start) + start)
}

const randomUtil = {
    randomNumberRange
}
export default randomUtil